package cl.alto.soap;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;


import cl.alto.clases.CausaAccidente;
import cl.alto.dao.*;


public class CausasAccidente implements Serializable {
	
	private static final long serialVersionUID = 1L;
	private Map<String,String> causas = new HashMap<String, String>();

	public CausasAccidente(){
		try {
			List<CausaAccidente> listaCausas = DaoCombos.getCausaAccidente();
			Iterator<CausaAccidente> iterator = listaCausas.iterator();
			while (iterator.hasNext()) {
				CausaAccidente causasAcc = iterator.next();
				causas.put(causasAcc.getNombre(), String.valueOf(causasAcc.getId()));
			}
		} catch (Exception e) {
			// TODO: handle exception
		}
		
	}
	
	public Map<String, String> getCausasAccidente() {
		return causas;
	}
}


